package com.example.weather;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

/**
 * Created by asd on 2016/9/20.
 */
public class HuoDongZhongXin extends Activity implements View.OnClickListener {
    private TextView tvMessage;
    private Button btn;
    private TextView tv;
    private int i = 0;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.huodongzhongxin);
        init();
        MyListener();
    }

    private void MyListener() {
        btn.setOnClickListener(this);
    }

    private void init() {
        tvMessage = (TextView) findViewById(R.id.tv_message);
        btn = (Button) findViewById(R.id.btn);
        tv = (TextView) findViewById(R.id.tv);
    }

    @Override
    public void onClick(View v) {
        int b = i++;

        tvMessage.setText(b + "次");
        if (b == 9999) {
            b = 0;
            tv.setText("逗你玩你也信，哪有钱给你发奖励");
        }
    }
}
